import 'package:json_annotation/json_annotation.dart';

part 'qr_statistics_detail_page.g.dart';

@JsonSerializable()
class QrStatisticsDetailPage extends Object {
  @JsonKey(name: 'items')
  List<QrStatisticsDetail> items;

  @JsonKey(name: 'total')
  int total;

  @JsonKey(name: 'totalPage')
  int totalPage;

  QrStatisticsDetailPage(
    this.items,
    this.total,
    this.totalPage,
  );

  factory QrStatisticsDetailPage.fromJson(Map<String, dynamic> srcJson) => _$QrStatisticsDetailPageFromJson(srcJson);

  Map<String, dynamic> toJson() => _$QrStatisticsDetailPageToJson(this);
}

@JsonSerializable()
class QrStatisticsDetail extends Object {
  @JsonKey(name: 'billStatus')
  int billStatus;

  @JsonKey(name: 'channelId')
  String channelId;

  @JsonKey(name: 'channelName')
  String channelName;

  @JsonKey(name: 'channelOrderNo')
  String channelOrderNo;

  @JsonKey(name: 'completeId')
  int completeId;

  @JsonKey(name: 'mchId')
  String mchId;

  @JsonKey(name: 'mchInfoId')
  int mchInfoId;

  @JsonKey(name: 'mchRefundNo')
  String mchRefundNo;

  @JsonKey(name: 'nickname')
  String nickname;

  @JsonKey(name: 'openid')
  String openid;

  @JsonKey(name: 'orderTime')
  String orderTime;

  @JsonKey(name: 'payDeviceId')
  int payDeviceId;

  @JsonKey(name: 'payOrderId')
  String payOrderId;

  @JsonKey(name: 'payStatus')
  int payStatus;

  @JsonKey(name: 'payTime')
  String payTime;

  @JsonKey(name: 'payType')
  int payType;

  @JsonKey(name: 'payTypeVO')
  PayTypeVO payTypeVO;

  @JsonKey(name: 'recordId')
  String recordId;

  @JsonKey(name: 'recordType')
  int recordType;

  @JsonKey(name: 'refundTime')
  String refundTime;

  @JsonKey(name: 'storeId')
  int storeId;

  @JsonKey(name: 'storeName')
  String storeName;

  @JsonKey(name: 'storeNo')
  String storeNo;

  @JsonKey(name: 'tableId')
  int tableId;

  @JsonKey(name: 'tableName')
  String tableName;

  @JsonKey(name: 'tip')
  int tip;

  @JsonKey(name: 'totalFee', defaultValue: 0)
  int totalFee;

  @JsonKey(name: 'unionOrderId')
  String unionOrderId;

  @JsonKey(name: 'userId')
  int userId;

  @JsonKey(name: 'waiterId')
  int waiterId;

  @JsonKey(name: 'waiterOpenid')
  String waiterOpenid;

  @JsonKey(name: 'refundAmount', defaultValue: 0)
  int refundAmount;

  QrStatisticsDetail(
    this.refundAmount,
    this.billStatus,
    this.channelId,
    this.channelName,
    this.channelOrderNo,
    this.completeId,
    this.mchId,
    this.mchInfoId,
    this.mchRefundNo,
    this.nickname,
    this.openid,
    this.orderTime,
    this.payDeviceId,
    this.payOrderId,
    this.payStatus,
    this.payTime,
    this.payType,
    this.payTypeVO,
    this.recordId,
    this.recordType,
    this.refundTime,
    this.storeId,
    this.storeName,
    this.storeNo,
    this.tableId,
    this.tableName,
    this.tip,
    this.totalFee,
    this.unionOrderId,
    this.userId,
    this.waiterId,
    this.waiterOpenid,
  );

  factory QrStatisticsDetail.fromJson(Map<String, dynamic> srcJson) => _$QrStatisticsDetailFromJson(srcJson);

  Map<String, dynamic> toJson() => _$QrStatisticsDetailToJson(this);
}

@JsonSerializable()
class PayTypeVO extends Object {
  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'type')
  int type;

  @JsonKey(name: 'typeName')
  String typeName;

  PayTypeVO(
    this.name,
    this.type,
    this.typeName,
  );

  factory PayTypeVO.fromJson(Map<String, dynamic> srcJson) => _$PayTypeVOFromJson(srcJson);

  Map<String, dynamic> toJson() => _$PayTypeVOToJson(this);
}
